﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Jack.RedisEventBus
{
    /// <summary>
    /// 事件发布者
    /// </summary>
    public interface IEventPublisher
    {
        Task Publish<TEvent>(TEvent @event, int db = -1, CancellationToken cancellationToken = default) where TEvent : IEvent;
        Task Publish<TEvent>(IEnumerable<TEvent> events, int db = -1, CancellationToken cancellationToken = default) where TEvent : IEvent;
    }
}
